pub(crate) const PTR_SIZE: usize = size_of::<*const usize>();
pub(crate) const PTR_SIZE_SHIFT: usize = PTR_SIZE.ilog2() as usize;
pub(crate) const SMALL_WSIZE_MAX: usize = 128;
pub(crate) const SMALL_SIZE_MAX: usize = SMALL_WSIZE_MAX * PTR_SIZE;

// Minimal alignment necessary. On most platforms 16 bytes are needed
// due to SSE registers for example. This must be at least `INTPTR_SIZE`
pub(crate) const MAX_ALIGN_SIZE: usize = 16;
pub(crate) const PAGE_HUGE_ALIGN: usize = 256 * 1024;
pub(crate) const SMALL_PAGE_SHIFT: usize = 13 + PTR_SIZE_SHIFT; // 64kb on 64bit
pub(crate) const SMALL_PAGE_SIZE: usize = 1 << SMALL_PAGE_SHIFT;
pub(crate) const LARGE_PAGE_SHIFT: usize = 6 + SMALL_PAGE_SHIFT; // 4mb on 64bit
pub(crate) const LARGE_PAGE_SIZE: usize = 1 << LARGE_PAGE_SHIFT;
pub(crate) const SEGMENT_SHIFT: usize = LARGE_PAGE_SHIFT; // 4mb on 64bit
pub(crate) const SEGMENT_SIZE: usize = 1 << SEGMENT_SHIFT;
pub(crate) const SEGMENT_MASK: usize = SEGMENT_SIZE - 1;
pub(crate) const SMALL_PAGES_PER_SEGMENT: usize = SEGMENT_SIZE / SMALL_PAGE_SIZE;
pub(crate) const LARGE_SIZE_MAX: usize = LARGE_PAGE_SIZE / 8; // 512kb on 64-bit
pub(crate) const LARGE_WSIZE_MAX: usize = LARGE_SIZE_MAX >> PTR_SIZE_SHIFT;

pub(crate) const BIN_HUGE: usize = 64;
pub(crate) const BIN_SIZE: usize = BIN_HUGE + 1;
pub(crate) const BIN_BLOCK_SIZE: [usize; BIN_SIZE] = [
    1,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    10,
    12,
    14,
    16,
    20,
    24,
    28,
    32,
    40,
    48,
    56,
    64,
    80,
    96,
    112,
    128,
    160,
    192,
    224,
    256,
    320,
    384,
    448,
    512,
    640,
    768,
    896,
    1024,
    1280,
    1536,
    1792,
    2048,
    2560,
    3072,
    3584,
    4096,
    5120,
    6144,
    7168,
    8192,
    10240,
    12288,
    14336,
    16384,
    20480,
    24576,
    28672,
    32768,
    40960,
    49152,
    57344,
    65536,
    81920,
    98304,
    114688,
    LARGE_WSIZE_MAX + 1, /*131072, Huge queue */
];
